package petrochina.company.electric.http.api;

import com.hjq.http.config.IRequestApi;

import java.util.Objects;

/**
 *    desc   : 获取登录
 */
public final class LoginApi implements IRequestApi {

    private String username;
    private String password;

    public LoginApi setUsername(String username) {
        this.username = username;
        return this;
    }

    public LoginApi setPassword(String password) {
        this.password = password;
        return this;
    }

    @Override
    public String getApi() {
        return "login/login";
    }

    public final class Bean {
        private long id;
        // 职责类型（1-监管 2-操作 3-抄表）
        private int dutyType;
        private String staffGroupName;
        private String staffName;
        private String duty;
        private String accessToken;

        public long getId() {
            return id;
        }

        public void setId(long id) {
            this.id = id;
        }

        public int getDutyType() {
            return dutyType;
        }

        public void setDutyType(int dutyType) {
            this.dutyType = dutyType;
        }

        public String getStaffGroupName() {
            return staffGroupName;
        }

        public void setStaffGroupName(String staffGroupName) {
            this.staffGroupName = staffGroupName;
        }

        public String getStaffName() {
            return staffName;
        }

        public void setStaffName(String staffName) {
            this.staffName = staffName;
        }

        public String getDuty() {
            return duty;
        }

        public void setDuty(String duty) {
            this.duty = duty;
        }

        public String getAccessToken() {
            return accessToken;
        }

        public void setAccessToken(String accessToken) {
            this.accessToken = accessToken;
        }

        @Override
        public String toString() {
            return "Bean{" +
                    "id=" + id +
                    ", dutyType=" + dutyType +
                    ", staffGroupName='" + staffGroupName + '\'' +
                    ", staffName='" + staffName + '\'' +
                    ", duty='" + duty + '\'' +
                    ", accessToken='" + accessToken + '\'' +
                    '}';
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (!(o instanceof Bean)) return false;
            Bean bean = (Bean) o;
            return getId() == bean.getId();
        }

        @Override
        public int hashCode() {
            return Objects.hash(getId());
        }
    }
}